package com.mall.service.impl;

import com.mall.dao.IItemCatDao;
import com.mall.domain.ItemCat;
import com.mall.domain.Menus;
import com.mall.service.IItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商品类别的业务层实现类
 * @author : Bei-Zhen
 * @date : 2021-01-04 16:54
 */
@Service("itemCatService")
public class ItemCatServiceImpl implements IItemCatService {

    @Autowired
    private IItemCatDao itemCatDao;

    /**
     * 查询商品类别父节点
     * @return
     */
    @Override
    public List<ItemCat> getTree(){
        return itemCatDao.getTree();
    }

    /**
     * 查询商品类别子节点
     * @param cat_pid
     * @return
     */
    @Override
    public List<Menus> listChild(int cat_pid){
        return itemCatDao.listChild(cat_pid);
    }
}
